<?php
include_once('header.inc.php');
securite();
$i=0;
$ids = $_POST['ids'];
$logins = $_POST['logins'];
foreach($ids as $id){
	$anniv = $db->select('firstname,lastname,birthdate,mail,phone',$CONFIG['table_birthdays'],'id='.$id);
	$data = $anniv[0];
	$data['userlogin'] = $_SESSION['login'];
	$db->insert($CONFIG['table_birthdays'],$data);
	$i++;
}
foreach($logins as $l){
	$anniv = $db->select('firstname,lastname,birthdate,mail',$CONFIG['table_users'],'login=\''.$l.'\'');
	$data = $anniv[0];
	$data['userlogin'] = $_SESSION['login'];
	$db->insert($CONFIG['table_birthdays'],$data);
	$i++;
}
redirection('browse.php?ok='.$i);
?>
